package com.f.manage.utils.前端参数转json;

public class WebGetJson{

    public String getParam(String param){
        param.replaceAll(" ","");
        String json = param.replaceAll("\n",",\"");
        json = json.replaceAll(":","\":");
        json = "{\""+json+"\"}" ;
        System.out.println(json);
        return json;
    }

    public static void main(String[] args) {
        WebGetJson webGetJson = new WebGetJson();
        String param = "\n" +
                "  \"id\": \"1582286990743871489\",\n" +
                "  \"floorInfo\": {\n" +
                "    \"id\": \"1582276504178565120\",\n" +
                "    \"unitInfo\": {\n" +
                "      \"id\": \"1582266316889432064\",\n" +
                "      \"buildingInfo\": {\n" +
                "        \"id\": \"1582258070489309184\",\n" +
                "        \"communityInfo\": {\n" +
                "          \"id\": \"1581932479047180288\"\n" +
                "        }\n" +
                "      }\n" +
                "    }\n" +
                "  }";
        String json = webGetJson.getParam(param) ;
        System.out.println(json);
    }


}
